package com.bytezero.inherit;

public class Person extends Creature
{
	String name;
	
	//私有
	private int age;
	
	public Person()
	{
		
	}
	public Person(String name ,int age)
	{
		this.name = name;
		this.age = age;
	}
	
	public void eat()
	{
		System.out.println("吃饭");
		sleep();//调用 私有方法  同类中可以调用
	}
	
	//私有
	private void sleep()
	{
		System.out.println("睡觉");
		
	}
	
	
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	
	
	
	
}

















































